package com.wuwei.jy.domain.g;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Article {
    private Integer id;

    private String title;

    private String img;

    private Date createDate;

    private Date endDate;

    private Integer type;

    private Integer weigh;

    private String wechatName;

    private String wechatUrl;

    private Integer readNumber;

    private Integer goodNumber;

    private Integer inuse;

    private String templet;

    private String content;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getWeigh() {
        return weigh;
    }

    public void setWeigh(Integer weigh) {
        this.weigh = weigh;
    }

    public String getWechatName() {
        return wechatName;
    }

    public void setWechatName(String wechatName) {
        this.wechatName = wechatName;
    }

    public String getWechatUrl() {
        return wechatUrl;
    }

    public void setWechatUrl(String wechatUrl) {
        this.wechatUrl = wechatUrl;
    }

    public Integer getReadNumber() {
        return readNumber;
    }

    public void setReadNumber(Integer readNumber) {
        this.readNumber = readNumber;
    }

    public Integer getGoodNumber() {
        return goodNumber;
    }

    public void setGoodNumber(Integer goodNumber) {
        this.goodNumber = goodNumber;
    }

    public Integer getInuse() {
        return inuse;
    }

    public void setInuse(Integer inuse) {
        this.inuse = inuse;
    }

    public String getTemplet() {
        return templet;
    }

    public void setTemplet(String templet) {
        this.templet = templet;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

    public String getCreateDateString(){
        if (getCreateDate() == null){
            return "";
        }
        return sdf.format(getCreateDate());
    }
    public String getEndDateString(){
        if (getEndDate() == null){
            return "";
        }
        return sdf.format(getEndDate());
    }

    public String getTypeString(){
        switch(getType()){
            case 1:return "热点";
            case 2:return "娱乐";
            case 3:return "养生";
            case 4:return "搞笑";
            case 5:return "奇闻";
            case 6:return "励志";
            case 7:return "科技";
            case 8:return "生活";
            case 9:return "财经";
            case 10:return "汽车";
            case 11:return "情感";
            case 12:return "星座";
            case 13:return "美食";
            case 14:return "时尚";
            case 15:return "旅游";
            case 16:return "育儿";
            case 17:return "体育";
            case 18:return "军事";
            case 19:return "历史";
            case 20:return "三农";
            case 21:return "故事";
            case 22:return "收藏";
        }
        return "";
    }
}